From 65afc94bc6d68cf42c9bfef8c56b50ceba60ed98 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 19 Jun 2009 08:43:58 +0100 Subject: [PATCH] x86: Fix legacy irq allocation issue When try to assign vector for irq, we should not assign vector for legacy irq, which has fixed mapped irq<->vector relationship. Signed-off-by: Jiang, Yunhong --- xen/arch/x86/irq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 8abaab913e..42e2b9d0ea 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -84,6 +84,12 @@ int assign_irq_vector(int irq) spin_lock(&vector_lock); + if ((irq != AUTO_ASSIGN_IRQ) && !IO_APIC_IRQ(irq)) + { + spin_unlock(&vector_lock); + return LEGACY_VECTOR(irq); + } + if ((irq != AUTO_ASSIGN_IRQ) && (IO_APIC_VECTOR(irq) > 0)) { spin_unlock(&vector_lock); return IO_APIC_VECTOR(irq); -- 2.30.2